﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Project_ScansiaPacific
{
    public partial class FrTTSanPham : DevComponents.DotNetBar.Office2007Form
    {
        private string child = " - ",MaSP;
        public FrTTSanPham()
        {
            InitializeComponent();
        }
        private void combo_load()
        {
            FormProcess Frp = new FormProcess();
            string select_sql = @"select MaSP,TenSP from dbo.SanPham";
            Frp.cb1(cb_MaSP, select_sql, 0, 1);
        }

        private void FrTTSanPham_Load(object sender, EventArgs e)
        {
            combo_load();
        }
        private void TTSP()
        {
            try
            {
                Process prs = new Process();
                DataSet ds = new DataSet();
                MaSP = prs.substring_left(cb_MaSP.Text, child);
                string search = @"select MaSP,TenSP,MaChiTiet,TenChiTiet,ChieuDaySC,ChieuRongSC,ChieuDaiSC,ChieuDayTC as ChieuDay,ChieuRongTC as ChieuRong,ChieuDaiTC as ChieuDai
                                from dbo.ThongTinSanPham where MaSP='" + MaSP + "'";
                ds = prs.dts(search);
                Fr_Report FrR = new Fr_Report();
                FrR.report_TTSP(ds);
                FrR.Show();
                ds.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

        }

        private void bt_search_Click(object sender, EventArgs e)
        {
            TTSP();
        }
    }
}
